package com.car.loan.project.xr.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.car.loan.project.xr.domain.OverdueInfo;
import java.util.List;
import java.util.Optional;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @author huangding
 * @date 2020/2/21 21:15
 */
@Repository
public interface OverdueInfoMapper extends BaseMapper<OverdueInfo> {

    /**
     *
     * @param loanId
     * @param item
     * @return
     */
    @Select("select * from  xr_overdue_info where  loan_id = #{loanId} and item = #{item}")
    Optional<OverdueInfo> selectOneByLoanIdAndItem(@Param("loanId") Long loanId,
        @Param("item") Integer item);

    @Select("select * from  xr_overdue_info where  loan_id = #{loanId}")
    List<OverdueInfo> selectByLoanId(@Param("loanId") Long loanId);
}
